package com.csii.activiti.server.core.mapper;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.csii.activiti.server.core.entity.ActFlowDone;
import com.csii.activiti.server.core.entity.ActFlowMyApply;
import com.csii.activiti.server.core.entity.ActFlowTodo;
import com.csii.activiti.server.core.entity.db.ActFlowInitiatorAndInstanceIdEntity;
import com.csii.activiti.server.core.entity.ActFlowProIdAndNode;
import com.csii.activiti.server.core.entity.db.ActFlowTaskIdAndCommentEntity;
import com.csii.activiti.server.core.query.QueryActFlowDone;
import com.csii.activiti.server.core.query.QueryActFlowMyApply;
import com.csii.activiti.server.core.query.QueryActFlowTodo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface ActExtensionMapper {

    List<ActFlowInitiatorAndInstanceIdEntity> queryRunFlowInitiatorByInstanceIds(@Param("instanceIds") Set<String> instanceIds);

    List<ActFlowInitiatorAndInstanceIdEntity> queryHiFlowInitiatorByInstanceIds(@Param("instanceIds") Set<String> instanceIds);

    List<ActFlowTaskIdAndCommentEntity> queryFlowCommentsByTaskIds(@Param("taskIds") Set<String> taskIds,@Param("userId") String userId,@Param("type") String type);

    List<ActFlowProIdAndNode> queryFlowProIdAndNodeByInstanceIds(@Param("instanceIds") Set<String> instanceIds, @Param("type") String type,@Param("unapproved")boolean unapproved);

    Set<String> queryFlowSignatureByTaskIdsResultExistTaskIds(@Param("taskIds") Set<String> taskIds);

    Page<ActFlowTodo> queryTodoList(Page page, @Param("assignee") String assignee, @Param("query") QueryActFlowTodo queryActFlowTodo,@Param("tenantId")String tenantId);

    Page<ActFlowDone> queryDoneList(Page page,@Param("assignee") String assignee,@Param("query") QueryActFlowDone queryActFlowDone,@Param("tenantId") String tenantId);

    Page<ActFlowMyApply> queryMyApplyList(Page page,@Param("assignee") String assignee,@Param("query")QueryActFlowMyApply queryActFlowMyApply,@Param("tenantId") String tenantId);

    long queryMyApplyCount(@Param("assignee") String assignee,@Param("query")QueryActFlowMyApply queryActFlowMyApply,@Param("tenantId") String tenantId);

    Set<String> queryLastApproveTaskIds(@Param("processInstanceId") String processInstanceId);



}
